﻿using System;
class TheSecretsOfNumbers
{
    static void Main()
    {
        string numAsText = Console.ReadLine();
        long sum = 0;
        for (int i = 0; i < numAsText.Length; i++)
        {
            if ((numAsText.Length - i) % 2 == 1)
            {
                sum += (numAsText.Length - i) * (numAsText.Length - i) * (numAsText[i] - '0');
            }
            else
            {
                sum += (numAsText[i] - '0') * (numAsText[i] - '0') * (numAsText.Length - i);
            }
        }
        Console.WriteLine(sum);
        if (sum % 10 == 0)
        {
            Console.WriteLine("{0} has no secret alpha-sequence", numAsText);
        }
        else
        {
            int r = (int)sum % 26;
            int count = (int)sum % 10;
            for (int i = 0; i < count; i++)
            {
                if (r+i>=26)
                {
                    r -= 26;
                }
                Console.Write("{0}", (char)('A' + r + i));
            }
            Console.WriteLine();
        }
    }
}